/*******************************************************************************
 * Copyright © 2017 FriendStar.Framework 版权所有
 * Author: HYF
 * Description: FriendStar快速开发平台
 * Website：http://www.FriendStar.cn
*********************************************************************************/
using FriendStar.Domain.Entity.WareHouse;
using FriendStar.Domain.IRepository.WareHouse;
using FriendStar.Repository.WareHouse;
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;

namespace FriendStar.Application.WareHouse
{
    public class CPK_93_TX_StoOperMonitoringApp
    {
        private ICPK_93_TX_StoOperMonitoringRepository service = new CPK_93_TX_StoOperMonitoringRepository();

        public List<CPK_93_TX_StoOperMonitoringEntity> GetList()
        {
            return service.IQueryable().ToList();
        }
        public CPK_93_TX_StoOperMonitoringEntity GetForm(string keyValue)
        {
            return service.FindEntity(keyValue);
        }
        public void DeleteForm(string keyValue)
        {
            /*if (service.IQueryable().Where(t => t.F_ParentId.Equals(keyValue)).Count() > 0)
            {
                throw new Exception("删除失败！操作的对象包含了下级数据。");
            }
            else
            {
                service.Delete(t => t.F_Id == keyValue);
            }
            */
        }
        public void SubmitForm(CPK_93_TX_StoOperMonitoringEntity cpk_93_tx_stoopermonitoringEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
               /* CPK_93_TX_StoOperMonitoringEntity.Modify(keyValue);*/
                service.Update(cpk_93_tx_stoopermonitoringEntity);
            }
            else
            {
                /*CPK_93_TX_StoOperMonitoringEntity.Create();*/
                service.Insert(cpk_93_tx_stoopermonitoringEntity);
            }
        }
    }
}
